package com.tuanzi.loan.web.lazy.prefilter;

import com.tuanzi.loan.business.service.product.prefilter.LoanProductPrefilterService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.product.prefilter.LoanProductPrefilterSearchRequest;
import com.tuanzi.loan.vo.response.product.prefilter.LoanProductPrefilterSearchResponse;
import com.tuanzi.loan.web.bean.CurrentUserBean;
import com.tuanzi.loan.web.lazy.LazyDataSessionModel;
import org.springframework.data.domain.Page;

/**
 * @author Ray 2017/09/21
 */
public class LoanProductPrefilterLazyDataModel extends LazyDataSessionModel<LoanProductPrefilterSearchRequest, LoanProductPrefilterSearchResponse> {

	private static final long serialVersionUID = 9143007553234885156L;

	private LoanProductPrefilterService productPrefilterService;

	public LoanProductPrefilterLazyDataModel(LoanProductPrefilterSearchRequest searchRequest, CurrentUserBean session, LoanProductPrefilterService productPrefilterService) {
		super(searchRequest, session);
		this.productPrefilterService = productPrefilterService;
	}

	@Override
	protected Page<LoanProductPrefilterSearchResponse> doLoad0(PageSearcher<LoanProductPrefilterSearchRequest> pageSearcher) {
		return productPrefilterService.list(pageSearcher);
	}
}
